package com.service.imp;

import com.dao.LoginDao;
import com.pojo.User;
import com.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class LoginServiceImp implements LoginService {
    @Autowired
    private LoginDao loginDao;
    public User login(User user) {
        return loginDao.login(user);
    }

    public int register(User user) {
        int i=loginDao.registerCount(user);
        if (i==0){
            return loginDao.register(user);
        }
        return -1;
    }

    public Integer dataAll() {
        return loginDao.dataAll();
    }

    public Integer data1() {
        return loginDao.data1();
    }

    public Integer data2() {
        return loginDao.data2();
    }

    public Integer data3() {
        return loginDao.data3();
    }

    public Integer data4() {
        return loginDao.data4();
    }
}
